package com.szj360.utils;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.codehaus.jackson.map.ObjectMapper;

public class JsonUtils {
	public static Map readJsonToMap(String json) {
		if (StringUtils.isBlank(json)) return new HashMap();
		ObjectMapper mapper = new ObjectMapper();
//		mapper.getDeserializerProvider().withAdditionalDeserializers(new BaseDeserializers());
		try {
			Map result = mapper.readValue(json, Map.class);
			if (result == null) result = new HashMap();
			return result;
		} catch (Exception e) {
			return new HashMap();
		}

	}
}
